from flask import Flask,render_template

app = Flask(__name__)


@app.route('/')
def hello_world():
    return 'Hello World!'


@app.route('/book/')
def book():
    books = [
        {
            'name': '西游记',
            'author': '吴承恩',
            'price': 109
        },
        {
            'name': '红楼梦',
            'author': '曹雪芹',
            'price': 100
        },
        {
            'name': '三国演义',
            'author': '罗贯中',
            'price': 99
        },
        {
            'name': '水浒传',
            'author': '施耐庵',
            'price': 150
        }
    ]
    return render_template('book.html',books=books)





if __name__ == '__main__':
    app.run()
